import React, { Component } from 'react'
import { Form, Input, InputNumber, Button } from 'antd';

const layout = {
  labelCol: { span: 8 },
  wrapperCol: { span: 16 },
};

export default class Edit extends Component {

  constructor(props){
    super(props)
    debugger
    this.state={
      name:this.props.name
    }
  }
  
  componentDidMount(props){
      console.log(this.state.name)
  }

  onFinish = (values) => {
    console.log(values.name);
  };

  render() {
    return (
      <div>
        <Form {...layout} name="nest-messages" onFinish={this.onFinish} initialValues={{
     name: 1
   }} >
          <Form.Item name={'name'} label="Name" rules={[{ required: false }]}>
            <Input defaultValue={'name'} />
          </Form.Item>
          {/* <Form.Item name={['user', 'email']} label="Email" rules={[{ type: 'email' }]}>
            <Input />
          </Form.Item>
          
          <Form.Item name={['user', 'website']} label="Website">
            <Input />
          </Form.Item>
          <Form.Item name={['user', 'introduction']} label="Introduction">
            <Input.TextArea />
          </Form.Item> */}
          <Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 8 }}>
            <Button type="primary" htmlType="submit">
              Submit
            </Button>
          </Form.Item>
        </Form>
      </div>
    )
  }
}
